package ui.juego

import dominio.investigacion.Caso
import java.awt.Color
import org.uqbar.arena.widgets.Button
import org.uqbar.arena.widgets.Label
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.windows.SimpleWindow
import org.uqbar.arena.windows.WindowOwner
import ui.juego.utilidades.IconUtils

class AceptarCasoWindow extends SimpleWindow<Caso> {
	
	new(WindowOwner parent, Caso model) {
		super(parent, model)
		title = modelObject.nombre
		iconImage = IconUtils.path
	}
	
	override protected addActions(Panel actionsPanel) {}
	
	override protected createFormPanel(Panel mainPanel) {}
	
	override createMainTemplate(Panel mainPanel) {
		new Label(mainPanel) => [
			text = "Detective, tenemos un caso para usted!"
			background = Color.ORANGE
			fontSize = 14
		]
		new Label(mainPanel) => [
			text = modelObject.reporte
			width = 250
			foreground = Color.WHITE 
			background = Color.GRAY 
		]
		new Button(mainPanel) => [
			caption = "Aceptar el caso"
			onClick [ |
				modelObject.vincular
				close
				new ResolverCasoWindow(this, new Investigacion(modelObject)).open
			]
		]
	}
	
}